// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import FastClick from 'fastclick'

//功能函数位置
import './assets/fonts/iconfont/iconfont'

// mint ui引用
import Mint from 'mint-ui';
import vueWaves from './directive/waves';
import vueSticky from './directive/sticky';

import 'mint-ui/lib/style.css'

Vue.use(Mint);
Vue.use(vueWaves);
Vue.use(vueSticky);

import {sync} from 'vuex-router-sync'
sync(store, router);

// css样式文件引入
require('animate.css');
require('./assets/css/utilities/icon_font.less');
require('./assets/css/utilities/change_mint_ui.less');
require('./assets/css/style.less');

//是否启用生产提示(主要针对debugger)
Vue.config.productionTip = false

// 页面批量调用组件
import * as copyright from "./components/partly/copyright"
import * as pic from "shared/components/Pic"
import * as PrRow from "shared/components/row.vue"
import * as PrCol from "shared/components/col.vue"
import 'shared/components/iconSvg/index'

Vue.component("copyright", copyright);
Vue.component("pic", pic);
Vue.component("PrRow", PrRow);
Vue.component("PrCol", PrCol);

/* eslint-disable no-new */

import Vuex from 'vuex';
import store from './store/index';
Vue.use(Vuex);

new Vue({
  el: '#app',
  store: store,
  router,
  template: '<App/>',
  components: { App },
  mounted: function () {
    FastClick.attach(document.body); // click延迟及点透问题
  }
})

//谷歌访问数据统计
router.afterEach(function (to) {
  if (window.ga) {
    window.ga('set', 'page', to.fullPath) // 你可能想根据请求参数添加其他参数，可以修改这里的 to.fullPath
    window.ga('send', 'pageview')
  }
})

//
